#include <cstdio>
int provide[62] = {0};
int need[62] = {0};
int transadd(char c, int hashtable[])
{ //统计各颜色个数
    if (c >= '0' && c <= '9')
        ++hashtable[c - '0'];
    else if (c >= 'a' && c <= 'z')
        ++hashtable[10 + c - 'a'];
    else
        ++hashtable[36 + c - 'A'];
}
int main()
{
    char c;
    bool flag = true; //标记是否满足要求
    int i;
    while ((c = getchar()) != '\n')
    {
        transadd(c, provide);
    }
    while ((c = getchar()) != '\n')
    {
        transadd(c, need);
    }
    for (i = 0; i < 62; ++i)
    { //判断是否满足要求
        if (provide[i] < need[i])
            flag = false;
    }
    int margin = 0;
    if (flag)
    { //满足要求
        printf("Yes ");
        for (i = 0; i < 62; ++i)
            margin += (provide[i] - need[i]);
    }
    else
    {
        printf("No ");
        for (i = 0; i < 62; ++i)
            if (need[i] > 0 && need[i] > provide[i])
                margin += need[i] - provide[i];
    }
    printf("%d\n", margin);
    return 0;
}